<template>
  <section class="features" id="products">
    <div class="container">
      <div class="section-header">
        <h2 class="section-title">核心价值与创新</h2>
        <p class="section-subtitle">通过智能化技术推动社会进步，实现正核博弈的共赢未来</p>
      </div>
      
      <div class="features-grid">
        <div class="feature-card" v-for="(feature, index) in features" :key="index" @click="openModal(feature)">
          <div class="feature-icon">
            <div class="icon-wrapper" :class="feature.iconClass">
              <div class="icon-inner"></div>
            </div>
          </div>
          <h3 class="feature-title">{{ feature.title }}</h3>
          <p class="feature-description">{{ feature.description }}</p>
          <div class="feature-glow"></div>
          <div class="click-hint">点击了解更多</div>
        </div>
      </div>
    </div>
    
    <!-- Modal for detailed information -->
    <ModalComponent 
      :isVisible="showModal" 
      :title="selectedFeature?.title"
      @close="closeModal"
    >
      <div v-if="selectedFeature" class="modal-details">
        <div class="detail-section">
          <h4>核心功能</h4>
          <ul>
            <li v-for="functionality in selectedFeature.functionalities" :key="functionality">{{ functionality }}</li>
          </ul>
        </div>
        
        <div class="detail-section">
          <h4>技术优势</h4>
          <p>{{ selectedFeature.technicalAdvantage }}</p>
        </div>
        
        <div class="detail-section">
          <h4>市场价值</h4>
          <p>{{ selectedFeature.marketValue }}</p>
        </div>
        
        <div class="detail-section">
          <h4>发展前景</h4>
          <p>{{ selectedFeature.developmentProspect }}</p>
        </div>
      </div>
    </ModalComponent>
  </section>
</template>

<script>
import ModalComponent from './ModalComponent.vue'

export default {
  name: 'FeaturesSection',
  components: {
    ModalComponent
  },
  data() {
    return {
      showModal: false,
      selectedFeature: null,
      features: [
        {
          title: 'Skillith智能平台',
          description: 'AI驱动的教育与企业协同平台，通过智能化手段提升青少年综合素养，实现教育与职场的无缝对接',
          iconClass: 'ai-icon',
          functionalities: [
            'AI智能匹配企业与人才需求',
            '区块链存证确保项目透明可信',
            '实时能力评估与成长轨迹记录',
            '企业项目与教育实践深度融合'
          ],
          technicalAdvantage: '采用先进的AI算法和区块链技术，确保平台的高效性、安全性和可信度。AI系统能够精准分析项目需求和人才能力，实现最优匹配。',
          marketValue: 'Skillith平台已获得芜湖市政府支持并成功落地，目标覆盖安徽省及周边省份，预计服务学生超过10万人，企业合作超过1000家。',
          developmentProspect: '随着平台不断扩展，将逐步覆盖更多省份和行业领域，成为连接教育与职场的重要桥梁，推动社会生产力的整体提升。'
        },
        {
          title: '正核博弈理念',
          description: '打破传统零和游戏，通过创新协作扩大社会总财富，让每个人的成功推动集体成功',
          iconClass: 'collaboration-icon',
          functionalities: [
            '创新协作模式设计',
            '社会财富总量增长机制',
            '贡献值量化与分配系统',
            '共赢生态构建'
          ],
          technicalAdvantage: '基于博弈论和经济学理论，结合区块链技术实现贡献值的量化、记录和分配，确保公平透明的价值创造和分配机制。',
          marketValue: '正核博弈理念将重塑传统经济模式，创造全新的价值创造和分配机制，具有颠覆性的市场潜力和社会价值。',
          developmentProspect: '随着理念的推广和实践，正核博弈将成为主流的经济合作模式，推动社会进入财富增长与全员共赢的新纪元。'
        },
        {
          title: '区块链存证',
          description: '所有任务执行过程与成果通过区块链技术存证，确保可信、透明、不可篡改',
          iconClass: 'blockchain-icon',
          functionalities: [
            '项目过程全程记录',
            '成果质量智能验证',
            '信用体系构建',
            '数据安全保护'
          ],
          technicalAdvantage: '采用分布式账本技术，确保数据的不可篡改性和可追溯性，结合智能合约实现自动化执行和验证。',
          marketValue: '区块链存证技术为平台提供了强大的信任基础，增强了用户信心，提升了平台的市场竞争力和商业价值。',
          developmentProspect: '随着区块链技术的成熟和应用，存证系统将不断完善，为更多行业提供可信的数据服务。'
        },
        {
          title: '智能风控系统',
          description: 'AI实时监控平台活动，确保项目进展透明合规，提供强大的风险预警机制',
          iconClass: 'security-icon',
          functionalities: [
            '实时风险监控与预警',
            '智能合规检查',
            '异常行为识别',
            '自动化风险处置'
          ],
          technicalAdvantage: '结合机器学习和大数据分析技术，实现风险的实时识别、评估和预警，确保平台运营的安全性和合规性。',
          marketValue: '智能风控系统是金融科技的核心需求，市场空间巨大且持续增长，为平台提供了重要的技术护城河。',
          developmentProspect: '随着AI技术的不断发展，风控系统将更加智能化，成为行业标准解决方案，具有广阔的应用前景。'
        },
        {
          title: '贡献值体系',
          description: '量化记录每个人的能力与贡献，通过可视化数据实现社会资源的高效分配',
          iconClass: 'value-icon',
          functionalities: [
            '个人能力量化评估',
            '贡献值计算与记录',
            '社会资源分配机制',
            '激励机制设计'
          ],
          technicalAdvantage: '基于大数据分析和AI算法，实现个人能力和贡献的精准量化，结合区块链技术确保数据的可信性。',
          marketValue: '贡献值体系将重塑社会资源分配模式，创造全新的价值创造和分配机制，具有巨大的社会和经济价值。',
          developmentProspect: '随着体系的完善和推广，贡献值将成为社会资源分配的重要载体，推动社会向更加公平高效的方向发展。'
        },
        {
          title: '跨星际愿景',
          description: '推动人类科技进步，支持生命延长技术突破，迈向跨星际文明的新时代',
          iconClass: 'future-icon',
          functionalities: [
            '生命延长技术研发',
            '跨星际技术积累',
            '文明进步推动',
            '无限发展空间探索'
          ],
          technicalAdvantage: '结合生物科技、航天技术和人工智能等前沿技术，为人类文明的进步提供技术支撑和创新动力。',
          marketValue: '跨星际愿景代表了人类发展的终极目标，具有无限的市场空间和价值潜力，是长期投资的最佳选择。',
          developmentProspect: '随着科技的不断进步，跨星际愿景将逐步实现，推动人类进入宇宙时代，创造前所未有的文明成就。'
        }
      ]
    }
  },
  methods: {
    openModal(feature) {
      this.selectedFeature = feature
      this.showModal = true
    },
    closeModal() {
      this.showModal = false
      this.selectedFeature = null
    }
  }
}
</script>

<style scoped>
.features {
  padding: 6rem 0;
  background: linear-gradient(180deg, #F5F7FA 0%, #FFFFFF 100%);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.3), transparent);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0A2463;
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #0066FF, #8A2BE2);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: #2D3748;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(0, 102, 255, 0.15);
  border-color: rgba(0, 102, 255, 0.3);
}

.feature-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(138, 43, 226, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 20px;
}

.feature-card:hover .feature-glow {
  opacity: 1;
}

.click-hint {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  color: rgba(0, 102, 255, 0.7);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover .click-hint {
  opacity: 1;
}

.feature-icon {
  margin-bottom: 1.5rem;
}

.icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.ai-icon {
  background: linear-gradient(135deg, #0066FF, #8A2BE2);
}

.collaboration-icon {
  background: linear-gradient(135deg, #8A2BE2, #00B9AE);
}

.blockchain-icon {
  background: linear-gradient(135deg, #00B9AE, #0066FF);
}

.security-icon {
  background: linear-gradient(135deg, #FF6B6B, #8A2BE2);
}

.value-icon {
  background: linear-gradient(135deg, #4ECDC4, #0066FF);
}

.future-icon {
  background: linear-gradient(135deg, #8A2BE2, #FF6B6B);
}

.icon-inner {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  position: relative;
}

.ai-icon .icon-inner::before {
  content: '🤖';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.collaboration-icon .icon-inner::before {
  content: '🤝';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.blockchain-icon .icon-inner::before {
  content: '⛓️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.security-icon .icon-inner::before {
  content: '🛡️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.value-icon .icon-inner::before {
  content: '💎';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.future-icon .icon-inner::before {
  content: '🚀';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0A2463;
  margin-bottom: 1rem;
}

.feature-description {
  color: #2D3748;
  line-height: 1.6;
  font-size: 1rem;
}

.modal-details {
  color: #2D3748;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section h4 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0A2463;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0066FF;
}

.detail-section ul {
  list-style: none;
  padding: 0;
}

.detail-section li {
  padding: 0.5rem 0;
  position: relative;
  padding-left: 1.5rem;
}

.detail-section li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #00B9AE;
  font-weight: bold;
}

.detail-section p {
  line-height: 1.7;
}

@media (max-width: 768px) {
  .features {
    padding: 4rem 0;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-card {
    padding: 2rem;
  }

  .container {
    padding: 0 1rem;
  }
}
</style>